package module.main.view.mainInterface
{	
	import com.darwin.darwinUI.containers.ContainerBase;
	import com.darwin.darwinUI.core.UIComponent;
	
	import module.main.MainConfig;
	import module.main.view.MainView;

	/**
	 *玩家信息面板 
	 * @author jichang
	 * 
	 */
	public class PlayerInformationPanel extends ContainerBase
	{
		private var _playHeadPlane:PlayHeadPlane;
		private var _playGradePlane:PlayGradePlane;
		private var uicommand:UIComponent;
		public function PlayerInformationPanel()
		{
			uicommand = new UIComponent();
			_playHeadPlane = new PlayHeadPlane();
			_playGradePlane = new PlayGradePlane();
			this.height = Math.max(_playHeadPlane.height,_playGradePlane.height);
			this.width = _playHeadPlane.width + _playGradePlane.width;
			uicommand.width = _playHeadPlane.width + _playGradePlane.width;
			uicommand.height = Math.max(_playHeadPlane.height,_playGradePlane.height);
			this.addItem(uicommand);
			init();
		}
		public function upDataPlayerInfo():void
		{
			if(MainView.getInstance().playerObj)
			{
				_playGradePlane.updateUI();
				//_playGradePlane.setYellowStarIcon();
			}
		}
		private function init():void
		{
			_playHeadPlane.x = 0;
			_playHeadPlane.y = 3;
			_playGradePlane.x = _playHeadPlane.width - 6;
			_playGradePlane.y = 0;
			uicommand.addChild(_playGradePlane);
			uicommand.addChild(_playHeadPlane);
		}
	}
}